class CreatePartnersProjects < ActiveRecord::Migration
  def self.up
    create_table :partners_projects, :id => false do |t|
      t.references :partner, :project
      t.string :role, :default => "participant"
    end
    # add relationships here
    execute "ALTER TABLE partners_projects ADD FOREIGN KEY (partner_id) REFERENCES partners(id)"
    execute "ALTER TABLE partners_projects ADD FOREIGN KEY (project_id) REFERENCES projects(id)"
    execute "ALTER TABLE partners_projects ADD PRIMARY KEY (partner_id,project_id);"
  end

  def self.down
  end
end
